﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Pheonix.Fashionzoomer.Entity.SqlServer2000;

public partial class admin_contactsdetail : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = SiteName + " - Contact Detail [ Admin ]";

        if (!IsPostBack)
        {
            try
            {
                if (Request["id"] != null)
                {
                    int id = 0;
                    if (int.TryParse(Request["id"], out id))
                        LoadData(id);
                }
            }
            catch (Exception ex)
            {
                uccResponseMessage.SetFailMessage("There was a problem in loading the page");
            }
        }
    }

    private void LoadData(int editDataId)
    {
        Contacts editContacts = null;
        if (editDataId != 0)
            editContacts = Contacts.GetContactsById(editDataId);
        if (editContacts != null)
        {
            lblMessage.Text = editContacts.SenderMessage;
            lblSenderName.Text = editContacts.SenderName;
            lblSenderEmail.Text = editContacts.SenderEmail;
            lblSenderPhone.Text = editContacts.SenderPhone;
            lblSentTime.Text = editContacts.SendTime.ToString();
        }
    }

    protected void Back_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("contacts.aspx");
    }
}
